const processedSql =
  "SELECT COUNT(*) as total  FROM blog b                         JOIN user u ON b.user_id = u.id                         WHERE b.status = 'published'                          Order By b.created_at DESC";
const placeholderCount = (processedSql.match(/\?/g) || []).length;
// console.log(placeholderCount);

let sql = "SELECT b.*, u.username  FROM blog b                         JOIN user u ON b.user_id = u.id                         WHERE b.status = 'published'                          AND b.title LIKE '%?%'  Order By b.created_at DESC LIMIT  ? , ? ";
let valSql = sql.split("?");
console.log(valSql);
